package thread;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class ThreadDemo21 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String > blockingQueue = new LinkedBlockingQueue<>();
        blockingQueue.put("1");
        blockingQueue.put("2");
        System.out.println(blockingQueue.take());
        System.out.println(blockingQueue.take());
        System.out.println(blockingQueue.take());
    }
}
